home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Updaters / WhiteCap 3.0.4 / WhiteCap Source.sit / WhiteCap Source / Headers / VIS.H < prev    next >
Text File  |  1997-11-13  |  2KB  |  47 lines

  1. // notes:
  2. // any window that remains in foreground should optimally pass 
  3. // keystrokes to the parent (winamp's) window, so that the user
  4. // can still control it. unless escape is hit, or some option 
  5. // key specific to the vis is hit. As for storing configuration,
  6. // Configuration data should be stored in <dll directory>\plugin.ini
  7. // Look at the example plugin for a framework.
  8.  
  9. // ints are 32 bits, and structure members are aligned on the default 8 byte boundaries
  10. // tested with VC++ 4.2 and 5.0
  11.  
  12.  
  13. typedef struct winampVisModule {
  14.   char *description; // description of module
  15.   HWND hwndParent;   // parent window (filled in by calling app)
  16.   HINSTANCE hDllInstance; // instance handle to this DLL (filled in by calling app)
  17.   int sRate;         // sample rate (filled in by calling app)
  18.   int nCh;             // number of channels (filled in...)
  19.   int latencyMs;     // latency from call of RenderFrame to actual drawing
  20.                      // (calling app looks at this value when getting data)
  21.   int delayMs;       // delay between calls in ms
  22.  
  23.   // the data is filled in according to the respective Nch entry
  24.   int spectrumNch;
  25.   int waveformNch;
  26.   unsigned char spectrumData[2][576];
  27.   unsigned char waveformData[2][576];
  28.  
  29.   void (*Config)(struct winampVisModule *this_mod);  // configuration dialog
  30.   int (*Init)(struct winampVisModule *this_mod);     // 0 on success, creates window, etc
  31.   int (*Render)(struct winampVisModule *this_mod);   // returns 0 if successful, 1 if vis should end
  32.   void (*Quit)(struct winampVisModule *this_mod);    // call when done
  33.  
  34.   void *userData; // user data, optional
  35. } winampVisModule;
  36.  
  37. typedef struct {
  38.   int version;       // VID_HDRVER
  39.   char *description; // description of library
  40.   winampVisModule* (*getModule)(int);
  41. } winampVisHeader;
  42.  
  43. // exported symbols
  44. typedef winampVisHeader* (*winampVisGetHeaderType)();
  45.  
  46. // version of current module (0x101 == 1.01)
  47. #define VIS_HDRVER 0x101